package com.atguigu.springcloud.generator;

import com.atguigu.springcloud.generator.properties.GeneratorProperties;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lenovo
 * @version 1.0
 * @date 2020/11/10 18:21
 */
@EnableConfigurationProperties
@ConfigurationPropertiesScan
@SpringBootApplication

@RestController
public class GeneratorApplication {
    public static void main(String[] args) {
        SpringApplication.run(GeneratorApplication.class);
    }


    private int i ;

    @Autowired
    private GeneratorProperties generatorProperties;

    @Autowired
    private CodeGenerator codeGenerator;

    @GetMapping("test")
    public String test(){
        System.out.println("test.............");
        codeGenerator.generator(generatorProperties);
        i++;
        return "test...hello["+i+"]";
    }



}
